import Vue from 'vue'
import VueRouter from 'vue-router'

// 一级路由
import frame from '@/views/frame'
import survey from '@/views/survey'

// frame二级路由
import home from '@/views/frame/home'
import message from '@/views/frame/message'
import scheme from '@/views/frame/scheme'
import us from '@/views/frame/us'

// survey二级路由
import baseMessage from '@/views/survey/baseMessage'
import demand from '@/views/survey/demand'
import support from '@/views/survey/support'
import useSituation from '@/views/survey/useSituation'

Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    { path: '/', redirect: '/frame/home' },
    {
      path: '/frame/index',
      component: frame,
      children: [
        { path: '/frame/home', component: home },
        { path: '/frame/message', component: message },
        { path: '/frame/scheme', component: scheme },
        { path: '/frame/us', component: us }
      ]
    },
    {
      path: '/survey/index',
      component: survey,
      children: [
        { path: '/survey/baseMessage', component: baseMessage },
        { path: '/survey/demand', component: demand },
        { path: '/survey/support', component: support },
        { path: '/survey/useSituation', component: useSituation }
      ]
    }
  ]
})

export default router
